<table cellpadding="0" cellspacing="0" width="100%" align="left" class="table-list">
    <col width="75%">
    <col width="25%">
    <tr class="alt">
        <td>
            <ul class="ul-list-order">
                <li class="list-order-header2">Họ tên</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_full_name']; ?></li>

            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Địa chỉ</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_address']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Điện thoại</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_phone_number']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Email</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_email']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Địa chỉ giao hàng</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_address_delivery']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">HT.Nhận hàng</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_delivery_name']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">HT.Thanh toán</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_payment_name']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Tên công ty</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_company_name']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Địa chỉ công ty</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_company_address']; ?></li>
            </ul>
            <ul class="ul-list-order">
                <li class="list-order-header2">Mã số thuế</li>
                <li class="list-order-info"><?php echo $aryOrderDetail['order_detail_company_tax_code']; ?></li>
            </ul>

        </td>
        <td>
            <div class="order_detail_status">Ngày tạo: <?php echo date('d/m/Y', strtotime($aryOrderDetail['order_detail_created_date'])); ?></div>
            <div class="order_detail_status">
                Trạng thái: <?php if ($aryOrderDetail['order_detail_is_process'] == 0) { ?>
                Chưa xử lý
                <?php } else if ($aryOrderDetail['order_detail_is_process'] == 1) { ?>
                    Đã xử lý
                <?php } else { ?>
                    Đang chờ xử lý
                <?php } ?>
            </div>
            <?php if ($aryOrderDetail['order_detail_process_date'] != '' && $aryOrderDetail['order_detail_process_date'] != '0000-00-00 00:00:00') { ?>
                <div class="order_detail_status">
                    Ngày xử lý: <?php echo date('d/m/Y', strtotime($aryOrderDetail['order_detail_process_date'])); ?>
                </div>
            <?php } ?>
            <?php if ($aryOrderDetail['order_detail_last_upate_date'] != '' && $aryOrderDetail['order_detail_last_upate_date'] != '0000-00-00 00:00:00') { ?>
                <div class="order_detail_status">
                    Ngày cập nhật cuối: <?php echo date('d/m/Y', strtotime($aryOrderDetail['order_detail_last_upate_date'])); ?>
                </div>
            <?php } ?>
        </td>
    </tr>

</table>
<table cellpadding="0" cellspacing="0" width="100%" align="left" class="table-list">
    <tr class="alt">
        <td colspan="5">
            <div style="font-weight: bold;">
                Danh sách sản phẩm
            </div>
        </td>
    </tr>
    <tr class="alt">
        <td width="20%" class="order_product_title">
            Danh mục
        </td>
        <td width="38%" class="order_product_title">
            Sản phẩm
        </td>
        <td width="12%" class="order_product_title" align="right">
            Số lượng
        </td>
        <td width="15%" class="order_product_title" align="right">
            Đơn giá(VNĐ)
        </td>
        <td width="15%" class="order_product_title" align="right">
            Thành tiền
        </td>
    </tr>
    <?php $totalPrice = 0;
    foreach ($aryProductOrder as $key => $value) {
        $totalPrice = $totalPrice + $value['product_order_total_price']; ?>
        <tr class="alt">
            <td>
                <a target="_blank" href="<?php echo $root_page; ?>/danhmuc/<?php echo $value['product_order_category_id']; ?>/<?php echo $value['product_order_category_filter']; ?>.html"><?php echo $value['product_order_category_name']; ?></a>
            </td>
            <td>
                <img class="img_product_order" src="/public/images/upload/thumbnail/<?php echo $value['product_order_product_image']; ?>">
                <a target="_blank" href="<?php echo $root_page; ?>/sanpham/<?php echo $value['product_order_product_id']; ?>/<?php echo $value['product_order_product_name_filter']; ?>.html"><?php echo $value['product_order_product_name']; ?></a>
            </td>
            <td align="right">
                <?php echo $value['product_order_total_product']; ?>&nbsp;/&nbsp;<?php echo $value['product_order_product_unit']; ?>
            </td>
            <td align="right">
                <?php echo number_format($value['product_order_product_price'], 0, ',', '.'); ?>
            </td>
            <td align="right">
        <?php echo number_format($value['product_order_total_price'], 0, ',', '.'); ?>
            </td>
        </tr>
<?php } ?>
    <tr class="alt">
        <td colspan="5" align="right">
            <div><span>Tổng số tiền:</span><span style="padding-left: 10px;"><?php echo number_format($totalPrice, 0, ',', '.'); ?>(VNĐ)</span></div>
        </td>
    </tr>
    <tr>
        <td>
            Ghi chú
        </td>
        <td colspan="2">
            <textarea cols="60" rows="10" id="order_detail_comment" name="order_detail_comment" class="text_order_comment"><?php echo $aryOrderDetail['order_detail_comment']; ?></textarea>
        </td>
        <td colspan="2">
<?php if ($aryOrderDetail['order_detail_is_process'] == 0 || $aryOrderDetail['order_detail_is_process'] == 2) { ?>
                <input type="button" class="submit cpointer" value="Xử lý sau" onclick="AdminController.updateStatusOrder(2, '<?php echo $aryOrderDetail['order_detail_id']; ?>');">
                <input type="button" class="submit cpointer" value="Hoàn thành" onclick="AdminController.updateStatusOrder(1, '<?php echo $aryOrderDetail['order_detail_id']; ?>');">
                <input type="button" class="submit cpointer" value="Chỉnh sửa" onclick="AdminController.showOverlayEditOrder('<?php echo $aryOrderDetail['order_detail_id']; ?>');">
                <input type="button" class="submit cpointer" value="Xóa" onclick="AdminController.deleteOrder('<?php echo $aryOrderDetail['order_detail_id']; ?>');">
                <input type="hidden" id="order_edit_list_product_id" name="order_edit_list_product_id" value="<?php echo $strProductId; ?>">
                <input type="hidden" name="order_customer_detail_id" id="order_customer_detail_id" value="<?php echo $detailId; ?>">
<?php } ?>
<?php if ($aryOrderDetail['order_detail_is_process'] == 1) { ?>
                <div class="order_is_proces">Đơn hàng đã được xử lý</div>
                <input type="button" class="submit cpointer" value="Khôi phục đơn hàng mới" onclick="AdminController.updateStatusOrder(0, <?php echo $aryOrderDetail['order_detail_id']; ?>);">
                <input type="button" class="submit cpointer" value="Khôi phục đơn hàng chờ xử lý" onclick="AdminController.updateStatusOrder(2, <?php echo $aryOrderDetail['order_detail_id']; ?>);">
<?php } ?>
        </td>
    </tr>
</table>